#ifndef prs_FrmPanelStyle_H
#define prs_FrmPanelStyle_H

#include "prs_FrmRules.h"
#include "prs_FrmFunc.h"
#include "prs_FrmStyleState.h"
#include "frm_control_TPanel.h"

namespace prs {

///////////////////////////////////////////////////////////////////////////////

struct TNodeFrmPanelStyle : public prs::TNodeStyleControl
{
  DECLARE_ClientNode()
  TAttrNodeType<nodeType_Panel> NodeType;
  TAttrObject<nodeType_Style,frm::control::TPanel::TStyle> Style;
  //
  TNodeFrmPanelStyle() : NodeType(this),Style(this) {}
};

///////////////////////////////////////////////////////////////////////////////

struct TRuleFrmPanelStyle : public snt::TRule
{
  TRuleFrmPanelStyle(
    snt::text::TContext &Context,
    svl::TVariant &VParentNode,
    TRuleFrmStyleState &RStyleState
  );
  
private:  
  TNodeFrmPanelStyle *GetNode() { return dynamic_cast<TNodeFrmPanelStyle*>(vParentNode.Pointer());}
  void FState(snt::TParams &Params) { rStyleState.SetState( &GetNode()->Style.Value );}
  //
  svl::TVariant &vParentNode;
  TRuleFrmStyleState &rStyleState;
  svl_Except;
};

///////////////////////////////////////////////////////////////////////////////
}

#endif
